package com.isoftstone.project.system.mapper;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysUserRoleMapper {

	//保存用户和角色的ID
	void saveUserRole(@Param(value = "userId") String userId, @Param(value = "roleId") String roleId) throws Exception ;


	//根据roleId删除Sys_Use_Role表中的信息
	void deleteByroleId(String roleId) throws Exception;

	void deleteByUserId(String userId);

	/**
	 * 根据用户名获取对应角色
	 * @param userId
	 * @return
	 * @throws Exception
	 */
    List<String> getRolesByUserId(String userId)throws Exception;

    String getRoleNameByUserId(String userId)throws Exception;

	List<String> getRolesByroleId(String roleId) throws Exception;

    List<String> getAppsByUserId(String userId);

}
